package inbound

import (
	"gateway/config"
	"gateway/core"
	"go.uber.org/zap"
)

const (
	PATH        = "path"
	METHOD      = "method"
	HTTP_METHOD = "httpMethod"
	HTTP_URL    = "httpUrl"
)

func getInboundFunc(name string) func(string) core.Inbound {
	switch name {
	case "httpInbound":
		return newHttpInbound
	default:
		return nil
	}
}

func NewInbound(name string) core.Inbound {
	f := getInboundFunc(name)
	if f == nil {
		config.Logger.Panic("Inbound not found", zap.String("name", name))
	}
	return f(name)
}
